package com.cg.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import lombok.Data;

import java.time.LocalDateTime;
@Data
public class Event{
    /**
     * 事件ID，主键自增
     */
    private Integer id;
    /**
     * 建立人账户
     */
    private String createdBy;
    /**
     * 事件分类ID
     */
    private Integer categoryId;
    /**
     * 事件标题
     */
    private String title;
    /**
     * 事件起始日期
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm")
    private LocalDateTime startDate;
    /**
     * 事件截止日期，可选
     */

    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm")
    private LocalDateTime endDate;


    /**
     * 事件具体内容
     */
    private String content;
    /**
     * 事件级别
     */
    private Integer level;
    /**
     * 事件状态
     */
    private Integer status;
    /**
     * 事件积分，默认为0
     */
    private String score;

    public LocalDateTime getStartDate() {
        return startDate;
    }

    public void setStartDate(LocalDateTime startDate) {
        this.startDate = startDate;
    }

    public LocalDateTime getEndDate() {
        return endDate;
    }

    public void setEndDate(LocalDateTime endDate) {
        this.endDate = endDate;
    }
}

